<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router';

const router = useRouter();
const features = ref([
  {
    title: '快速传输',
    description: '支持多种传输方式，包括局域网、蓝牙和云存储',
    icon: '📱',
  },
  {
    title: '安全可靠',
    description: '端到端加密，确保您的数据安全',
    icon: '🔒',
  },
  {
    title: '跨平台支持',
    description: '支持 Windows、macOS、iOS 和 Android',
    icon: '💻',
  },
]);

const startTransfer = () => {
  router.push('/transfer');
};
</script>

<template>
  <div class="home">
    <div class="hero">
      <h1 class="title">EasyDrop</h1>
      <p class="subtitle">简单、快速、安全的文件传输工具</p>
      <a-button type="primary" size="large" @click="startTransfer">开始传输</a-button>
    </div>

    <div class="features">
      <div class="feature-card" v-for="feature in features" :key="feature.title">
        <div class="feature-icon">{{ feature.icon }}</div>
        <h3>{{ feature.title }}</h3>
        <p>{{ feature.description }}</p>
      </div>
    </div>

    <div class="stats">
      <div class="stat-item">
        <h2>1M+</h2>
        <p>用户</p>
      </div>
      <div class="stat-item">
        <h2>100TB+</h2>
        <p>传输数据</p>
      </div>
      <div class="stat-item">
        <h2>99.9%</h2>
        <p>可靠性</p>
      </div>
    </div>
  </div>
</template>

<style scoped>
.home {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  padding: 4rem 0;
  background: linear-gradient(180deg, rgba(24, 144, 255, 0.03) 0%, rgba(24, 144, 255, 0.01) 100%);
  border-radius: 16px;
  margin-bottom: 3rem;
}

.title {
  font-size: 3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #1890ff;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.subtitle {
  font-size: 1.25rem;
  color: rgba(0, 0, 0, 0.45);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 2rem 0 4rem;
}

.feature-card {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: rgba(0, 0, 0, 0.85);
  font-weight: 500;
}

.feature-card p {
  color: rgba(0, 0, 0, 0.45);
  line-height: 1.6;
  font-size: 1rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 2rem 0;
  text-align: center;
  background: #f5f5f5;
  border-radius: 12px;
  margin-top: 2rem;
}

.stat-item h2 {
  font-size: 2rem;
  color: #1890ff;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.stat-item p {
  color: rgba(0, 0, 0, 0.45);
  font-size: 1rem;
}
</style> 